Skip to content

feat: add furyctl get cluster-info command#652

Open
stefanoghinelli wants to merge 4 commits intomainfrom
feat/add-cluster-info-cmd
Open

feat: add furyctl get cluster-info command#652
stefanoghinelli wants to merge 4 commits intomainfrom
feat/add-cluster-info-cmd

Conversation

@stefanoghinelli
Copy link
Copy Markdown
Member

Summary 💡

Implements the furyctl get cluster-info command, which displays a quick overview of a running cluster's configuration and status.

Closes: sighupio/product-management/issues/642

Description 📝

All values are read from the configmaps/secrets that furyctl stores in the kube-system namespace; the Kubernetes version and node list are retrieved via live kubectl queries.

The last configuration change time is read from the furyctl-config secret. It is printed in UTC.

The ongoing upgrade status is read from the furyctl-upgrade-state configmap and reports the first pending or failed phase with its status.

Nodes are grouped by their primary node-role.kubernetes.io/* label. Since a node can carry multiple role labels, is applied a deterministic order: control-plane first, then master, then alphabetical, then those with no role.

The --format / -f flag supports text (default), json, and yaml.

Example txt output

./furyctl get cluster-info
Cluster Name:               test-onprem
SD Version:                 v1.34.0
SD Kind:                    OnPremises
SD Installer version:       v1.34.4
SD Upgrade paths:           None
SD Ongoing upgrade:         None
Kubernetes version:         v1.34.4
Etcd topology:              Stacked
Last configuration change:  2026-04-08 06:49:27 (UTC)
Custom Patches present:     Yes

Module             Version  Type
--------------------------------
Networking         v3.1.0   cilium
Ingress            v5.0.0   haproxy/single
Monitoring         v4.1.0   none
Logging            v5.3.0   none
Tracing            v1.4.0   none
Policy             v1.16.0  none
Auth               v0.6.1   none
Disaster Recovery  v3.3.0   none

Plugin Name             Type
----------------------------
local-path-provisioner  Kustomize
ldap-local              Kustomize
s1-agent                Helm

Node Role      Qty  vCPU  RAM(GiB)
---------------------------------
control-plane  1    2     3.8
infra          3    12    16.9
worker         2    8     11.3
<none>         1    4     5.6
=================================
Total          7    26    37.6

Breaking Changes 💔

None.

Tests performed 🧪

  • Unit tests
  • Integration test
  • Linting passes with no issues
  • Manual test against all providers

Future work 🔧

  • This first implementation extracts everything is already available, which phase failed/is pending, and its status. The "from which version" detail cannot be fulfilled with the current data since the information simply isn't stored there. To support it, the upgrade.State struct would need to be extended to include From and To version fields, populated when furyctl starts an upgrade. That's a separate change in the upgrade flow, outside the scope of this PR.
  • The “nice-to-have” features will be addressed in a future iteration.

@stefanoghinelli stefanoghinelli self-assigned this Apr 8, 2026
@stefanoghinelli stefanoghinelli force-pushed the feat/add-cluster-info-cmd branch from 85601a8 to 27c8546 Compare April 8, 2026 14:15
// extractModules combines types from furyctl config with versions from the KFD
// YAML. Fixed order keeps output stable; for EKS, an AWS row is appended when
// present.
func extractModules(configMap map[string]any, sd distroconf.KFD, kind string) []ModuleInfo {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note for reviewers: extractModules is intentionally static, display names differ from yaml keys (opa is "Policy", dr is "Disaster Recovery"), each module has its own type extraction logic, and versions are sourced from the typed distroconf.KFD struct. Adding a new module requires an explicit entry.

@stefanoghinelli stefanoghinelli marked this pull request as ready for review April 8, 2026 14:26
Copy link
Copy Markdown
Member

@ralgozino ralgozino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A first round of review, I'll take a closer look in the next days

Comment thread cmd/get/cluster-info.go Outdated
Comment thread cmd/get/cluster-info.go
return result
}

func etcdTopology(kind string, configMap map[string]any) string {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this func will need to be adapted to support immutable

return etcdDedicated
}

func installerVersion(kind string, sd distroconf.KFD) string {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this func will need to be adapted to support immutable

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cannot be added now because fury-distribution v1.34.0 does not yet expose KFDKubernetes.Immutable. I will add the case along with the dependency update once Kubernetes.Immutable is merged into the main branch. WDYT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants